package com.fbinggun.fbinggunutil.statistics.datatype;

import com.alibaba.fastjson.JSONObject;
import com.fbinggun.fbinggunutil.statistics.StatisticsInfo;

public class DoubleInfo extends StatisticsInfo<Double> {


    public DoubleInfo(String id, Double aDouble) {
        super(id, aDouble);
    }

    public DoubleInfo(String id, JSONObject jsonObject) {
        super(id, jsonObject);
    }

    @Override
    public StatisticsInfo copy(String id, JSONObject jsonObject) {
        return new DoubleInfo(id,jsonObject);
    }

    @Override
    public StatisticsInfo copy(String id, Double aDouble) {
        return new DoubleInfo(id,aDouble);
    }

    @Override
    public void addValue(Double aDouble) {
       t=aDouble+t;
    }
    @Override
    protected void addSValue(String v) {
        t=Double.parseDouble(v)+t;
    }

    @Override
    protected void setSValue(String value) {
        t=Double.parseDouble(value);
    }

    @Override
    public String getPlaceholder() {
        return String.valueOf(getValue());
    }

}
